/**
 * 1.默认参数
 * 2.箭头函数
 */
// 传统
var sum = function(a, b) {
    return a + b;
};
console.log(sum(1, 2));

// 默认值
console.log(sum(100));
var sum1 = function(a = 100, b = 100) {
    return a + b;
}
console.log(sum1(1));

/**
 * 箭头函数演进
 */
var sum2 = (a, b=10) => {
    return a + b;
}
console.log(sum2(1));

var sum3 = (a, b) => a + b;
console.log(sum3(3, 4));

var area = r => Math.pow(r, 2) * Math.PI;
console.log(area(2));